﻿Imports System
Imports System.IO
Imports System.Data.OleDb
Imports System.Data
Imports System.Drawing
Imports System.Drawing.Imaging

Namespace Arwani
    Partial Class Backend_SearchUserByCode
        Inherits System.Web.UI.Page


        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            If (Session("ADMIN_USER") IsNot Nothing) Then
                Me.divDetail.Visible = False
            Else
                Response.Redirect("Default.aspx")

            End If

        End Sub
        
      
        Protected Sub btnGo_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnGo.Click
            Dim awrcon As New ArwaniController
            Dim str As String = "select * from Raffle where code ='" & txtEnterCode.Text & "'"
            Dim dtTable As DataTable = awrcon.ExecuteQuery(str)
            If dtTable.Rows.Count > 0 Then
                Me.lblCodeis.Text = txtEnterCode.Text
                Me.lblCompanyName.Text = dtTable.Rows(0)("ComapanyName").ToString()
                Me.lblContactName.Text = dtTable.Rows(0)("ContactName").ToString()
                Me.lblEmailID.Text = dtTable.Rows(0)("EmailID").ToString()
                Me.lblMobileNumber.Text = dtTable.Rows(0)("MobilePhoneNumber").ToString()
                Me.lblOfficerNumber.Text = dtTable.Rows(0)("OfficePhoneNumber").ToString()
                lblErrorMsg.Text = ""
                Me.divDetail.Visible = True
            Else
                lblErrorMsg.Text = "The code is not exist"

            End If
        End Sub
    End Class
End Namespace